package uit.shoeshop.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;

import com.opensymphony.xwork2.ActionSupport;

import uit.shoeshop.model.AboutusModel;
import uit.shoeshop.model.SidebarModel;
import uit.shoeshop.dto.InformationDTO;
public class AboutAction extends ActionSupport implements ServletRequestAware,ServletResponseAware{
	private static final long serialVersionUID = 1L;
	private HttpServletRequest request;
	private HttpServletResponse response;

	private InformationDTO aboutus;
	@Override
	public void setServletRequest(HttpServletRequest request) {
		this.request = request;
	}

	@Override
	public void setServletResponse(HttpServletResponse response) {
		this.response = response;
	}
	
    public String execute() throws Exception {
    	AboutusModel about = new AboutusModel();
    	try{
    		setAboutus(about.getPageAboutUs());
    		if(getAboutus() == null || getAboutus().getTitle() == null){
    			return ERROR;
    		}
    	}catch(Exception e){
    		return ERROR;
    	}finally{
    		about = null;
    	}
        return SUCCESS;
    }

	/**
	 * @param aboutus the aboutus to set
	 */
	public void setAboutus(InformationDTO aboutus) {
		this.aboutus = aboutus;
	}

	/**
	 * @return the aboutus
	 */
	public InformationDTO getAboutus() {
		return aboutus;
	}	
}
